#include "IndexBuffer.h"

using namespace Nezha;

 const u16 IndexBuffer::msIndexTypeSize[IndexBuffer::IT_NUM] =
{
	sizeof(unsigned short),
	sizeof(unsigned int)
};

IndexBuffer::IndexBuffer(HardwareBuffer::Usage usage, IndexType it, u32 numIndices, bool createShadowBuffer)
	:HardwareBuffer(usage, createShadowBuffer)
	,mNumIndices(numIndices)
	,mIndexType(it)
{
	mSizeInBytes = mNumIndices * msIndexTypeSize[mIndexType];

	if(createShadowBuffer)
	{
		mShadowBuffer.resize(mSizeInBytes);
	}
}

IndexBuffer::~IndexBuffer()
{

}